package com.test;

public class thread01 extends Thread {
    int ticket = 10;
    public void run(){
        while(this.ticket>=0) {
            System.out.println(this.getName()+"买票--》"+(this.ticket--));
            //System.out.println("线程运行");
        }
    }

    public static void main(String[] args) {
       thread01 t1 =new thread01();
       thread01 t2 =new thread01();
       thread01 t3 =new thread01();
        t1.setName("窗口1");
        t2.setName("窗口2");
        t3.setName("窗口3");
        t1.start();
        t2.start();
        t3.start();

    }

}
